'''获取黄委许可决定和技术报告'''

# http://zw.yrcc.gov.cn/zwxxlist.jsp?bm=1120100


import requests
import codecs
import os
from bs4 import BeautifulSoup as bs
# import cssselect
# from lxml.html import etree
# import re


# http://zw.yrcc.gov.cn/zwxxlist.jsp?bm=1120100&page=1
# http://zw.yrcc.gov.cn/zwxxlist.jsp?bm=1120100&page=1

n = 76
m = 0
for x in range(n):
    x = x + 1
    r = requests.get('http://zw.yrcc.gov.cn/zwxxlist.jsp?bm=1120100&page=%s' %x)
    # print(r.encoding)

    data = r.text
    soup = bs(r.text, 'html.parser')
    # print(data)
    # print(soup.prettify())

    #

    a = soup.find_all("a", target="_blank")
    for i in a:
        if i.find("font"):
            # print(i)
            name = i['title']
            href = 'http://zw.yrcc.gov.cn/' + i['href']
            print(name)
            print(href)
            j = i.parent
            k = j.next_sibling
            # print(j)
            # print(k.text[-10:])
            m = m +1



print(m)



